package com.yzy.controller.init;

import com.yzy.util.algorithm.BCryptPassword;
import com.yzy.domain.entity.system.Account;
import com.yzy.mapper.system.AccountMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @Description: 初始化
 * 
 * @Date: 2022/12/13
 **/
@Configuration
public class Init {

    @Resource
    private AccountMapper accountMapper;

    // 初始化账号 admin
    // @Bean
    public void initAccount() {
        Account account = new Account();
        account.setPassword(BCryptPassword.encodePassword("admin"));
        account.setUserName("admin");
        accountMapper.insert(account);
    }
}
